package cn.jiyun.config;

import cn.jiyun.pojo.User;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class UserConfig {

    @Bean //作用：将自定义对象交由spring容器管理(未加自定义对象为空)
    @ConfigurationProperties(prefix = "user") //读取配置文件用户信息，并赋值给User对象
    public User user(){
        User user = new User();
        return user;
    }
}
